home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD World 1998 January
/
CD World - Ocak 1998.iso
/
misc
/
dbase55
/
disk7
/
utils.pak
/
SQLDBASE.DBT
(
.txt
)
< prev
next >
Wrap
dBase/FoxBase/XBase/FoxPro Database File
|
1996-01-05
|
9KB
|
141 lines
SQLDBASE
use Animals
set fields to
1513R
use in Animalset fields to
1513R
select name, street from Customer order by name
1513R
use Customer order name
set fields to name, street3
1513R
use in Customer
set fields toields to name, street3
1513R
select distinct;
C.name, O.order_no, L.stock_no, L.qty, L.sell_price;
from orders O, customer C, lineitem L;
where C.customer_n = O.customer_n;
and O.order_no = L.order_no;
order by C.name
1513R
use Customer order name in select()
use Orders order customer_n in select()
use Lineitem order order_no in select()
select Customer
set relation to customer_n into Orders constrain
select Orders
set relation to order_no into Lineitem constrain
select Customer
set skip to Orders, Lineitem
set fields to Customer->name, Orders->order_no, ;
Lineitem->stock_no, Lineitem->qty, ;
Lineitem->sell_price
use in Lineitem
use in Orders
use in Customer
set fields to_n in select()
use lineitem order order_no in select()
select customer
set relation to customer_n into orders constrain
select orders
set relation to order_no into lineitem constrain
select customer
set skip to orders, lineitem
set fields to customer->name, orders->order_no, ;
lineitem->stock_no, lineitem->qty, ;
lineitem->sell_price
select C.name, sum(O.amt_paid) total_paid;
from Customer C, Orders O;
where C.customer_n = O.customer_n;
group by customer_n having min(amt_paid) > 1500o orders constrain
select orders
set relation to order_no into lineitem constrain
select customer
set skip to orders, lineitem
set fields to customer->name, orders->order_no, ;
lineitem->stock_no, lineitem->qty, ;
lineitem->sell_price
use Customer in select() order customer_n exclusive
select Customer
append blank
replace name with "dBASE Customer", customer_n with "0000"
set fields to Customer->name, Customer->customer_nrders
set relation to order_no into lineitem constrain
select customer
set skip to orders, lineitem
set fields to customer->name, orders->order_no, ;
lineitem->stock_no, lineitem->qty, ;
lineitem->sell_price
delete from Customer where customer_n = "0000"usive
select customer
append blank
replace name with "dBASE Customer", customer_n with "0000"
set fields to customer->name, customer->customer_nrders
set relation to order_no into lineitem constrain
select customer
set skip to orders, lineitem
set fields to customer->name, orders->order_no, ;
lineitem->stock_no, lineitem->qty, ;
lineitem->sell_price
select * from Animals "0000"
delete
use in customer
set fields tond blank
replace name with "dBASE Customer", customer_n with "0000"
set fields to customer->name, customer->customer_nrders
set relation to order_no into lineitem constrain
select customer
set skip to orders, lineitem
set fields to customer->name, orders->order_no, ;
lineitem->stock_no, lineitem->qty, ;
lineitem->sell_price
select Customer
seek "0000"
delete
use in Customer
set fields to
use Orders order customer_n in select()
select Orders
total on customer_n to Total0 fields amt_paid
use Total0
use Customer in select()
join with Customer to Total1;
for customer_n = Customer->customer_n .and.;
Total0->amt_paid > 1500;
fields customer->name, Total0->amt_paid
use Total1 exclusive
index on name tag name
go top
wwwwww
wwpwww
wwpwww
wwwwww
wwwwww
use in Customer
use in Total1
delete table Total0
delete table Total1o;
where c.customer_n = o.customer_n;
group by customer_n && having min(amt_paid) > 500 500
insert into Customer (name, customer_n);
values ("SQL Customer", "0000")
select name, customer_n from Customer order by customer_nect()
join with Customer to Total1;
for customer_n = customer->customer_n;
fields customer->name, total->amt_paid
use Total1 excl
index on name tag name
go top
VhL @
t&h\ @
select C.name, sum(O.amt_paid) total_paid;
from Customer C, Orders O;
where C.customer_n = O.customer_n;
group by customer_n having min(O.amt_paid) > 1500al1;
for customer_n = Customer->customer_n;
fields customer->name, Total0->amt_paid
use Total1 exclusive
index on name tag name
go topD